package arithmetic;

import java.util.Scanner;

//判断回文数
public class Arithmetic16 {

        public static boolean isPalindrome(int x){
            if(x<0 || (x%10==0&&x!=0)){
                return false;
            }
            int revertedNumber =0;
            while (x>revertedNumber){

                revertedNumber = revertedNumber*10+x%10;
                x/=10;
            }
            return x==revertedNumber||x==revertedNumber/10;
        }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println(Arithmetic16.isPalindrome(sc.nextInt()));

    }

    }


